﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace EventLogger.Web.Views.Browse
{
    public class Browse : System.Web.Mvc.ViewUserControl<IEnumerable<EventLogger.DataLayer.EventEntity>>
    {
        protected int CurrentPage
        {
            get
            {
                return (int)ViewData["currentPage"];
            }
        }

        protected int TotalPages
        {
            get
            {
                return (int)ViewData["totalPages"];
            }
        }

        protected int PreviousPage
        {
            get
            {
                if (CurrentPage==1)
                {
                    return 1;
                }
                else
                {
                    return CurrentPage - 1;
                }
            }
        }

        protected int NextPage
        {
            get
            {
                if (CurrentPage == TotalPages)
                {
                    return TotalPages;
                }
                else
                {
                    return CurrentPage + 1;
                }
            }
        }
    }
}
